Welcome to the Cloud API Backend Server repository. This backend service powers the StunBy platform, providing essential APIs for application functionalities.
To get started with the project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/StunBy-Bangkit-Capstone/cloud-api.git
-
Navigate to the project directory:
cd cloud-api -
Install dependencies:
npm install
Ensure you have Node.js and npm installed before running this command.
Create a .env file in the root directory and add the following environment variables:
PORT=3000
DATABASE_URL=<your-database-url>
JWT_SECRET=<your-jwt-secret>
CLOUD_STORAGE_BUCKET=<your-cloud-storage-bucket>Replace <your-database-url>, <your-jwt-secret>, and <your-cloud-storage-bucket> with your actual configuration values.
Run the following command to apply database migrations:
npx prisma migrate devTo run the server in development mode:
npm run devFor production mode:
npm startThe backend will be running on http://localhost:3000 by default.
- Authentication: User registration, login, and token-based authentication.
- Cloud Integration: Handles cloud storage interactions using Cloud Run.
- Database Management: Efficient and optimized data storage using Prisma ORM.
- Scalable CI/CD: Deployed using GitHub Actions integrated with Google Cloud Run.
Comprehensive API documentation is available in the docs folder. Refer to docs/api-docs.md for detailed usage instructions, including:
The project is configured for Continuous Integration/Continuous Deployment (CI/CD) with GitHub Actions and Google Cloud Run. Follow these steps to deploy:
-
Push changes to the
mainbranch:git push origin main
-
The CI/CD pipeline will automatically build and deploy the project to Cloud Run.
-
To monitor deployment logs, visit your Google Cloud Console.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-feature-name
- Commit your changes:
git commit -m "Add your feature description" - Push your branch and open a pull request:
git push origin feature/your-feature-name
This project is licensed under the MIT License. See the LICENSE file for details.