API System for Pulo Aceh Destination
- Register at
/users/auth/register. To register as an admin, include"is_admin": trueand fillsecret_keysame as in .env file. - Only admins can view sensitive data or add data such as places.
- Start login by clicking the authorize button at the top right of the Swagger API for easy access to other endpoints (automatically adds access token to the header).
- Edit the token (result from
/users/auth/login) indummy.pyand run it to easily create fake place data.
To install and run the API project, follow these steps:
-
Clone the repository to your local machine:
git clone https://github.com/riparuk/pulo-aceh-api.git
-
Navigate to the project directory:
cd pulo-aceh-api -
Create a virtual environment and activate it:
python3 -m venv venv source venv/bin/activate -
Install the required dependencies:
pip install -r requirements.txt
-
Copy
.env.exampleto.envand fill the key
To run the API project, execute the following command:
fastapi dev app/main.pyThis will start the FastAPI development server and reload the application whenever changes are made.
You can now access the API at http://localhost:8000.
To run the API project using Docker, follow these steps:
-
Build the Docker image:
docker build -t pulo-aceh-api .This command will create a Docker image named
pulo-aceh-apibased on the Dockerfile in the current directory. -
Run the Docker container:
docker run -d --name pulo-aceh-api -p 8000:8000 pulo-aceh-api
This command will start a new container named
pulo-aceh-apiin detached mode, mapping port 8000 of the container to port 8000 on your host machine. -
List running Docker containers:
docker ps
This command will display a list of all running Docker containers, allowing you to verify that
pulo-aceh-apiis running. -
Stop the Docker container:
docker stop pulo-aceh-api
This command will stop the running
pulo-aceh-apicontainer. -
Remove the Docker container:
docker rm pulo-aceh-api
This command will remove the stopped
pulo-aceh-apicontainer from your system.- JWT Done
- OTP
- Register akun dengan OTP
- Lupa Password (Change Password) dengan OTP
- User bisa Ubah password
- User bisa Ubah email dgn kirim OTP ke Email baru dan verify
- Upload gambar untuk update profile
- Upload gambar tempat wisata
- Depend login atau belum saat akses endpoint masih bug/bad logic (harus login jika butuh get_current_user, tidak bisa hanya token/key)
- User bisa kirim rating
- mengembalikan Rating berdasarkan user rating
- mengembalikan photo url profile dan wisata dalam bentull full path url (no need, frontend handling it)