This repository contains the Strapi backend for the Esplend'or Rings website. It is responsible for managing the CMS, user authentication, GraphQL API, and all server-side logic.
- GraphQL API: Supports efficient and structured data queries.
- User Authentication: Role-based access control with Strapi’s Users & Permissions plugin.
- Cloudinary Integration: For media storage and management.
- SendGrid Integration: For email communication (e.g., order confirmations, promotions).
- Custom Privacy Handlers:
- Users can only access their own data.
- Field-level access restrictions for sensitive information.
- Database: PostgreSQL hosted on Aiven.
- Custom Controllers: Extends Strapi's default functionalities for enhanced customization.
- CMS: Strapi (v5.4.0)
- Database: PostgreSQL
- Media Storage: Cloudinary
- Email Provider: SendGrid
- GraphQL Plugin: Enables seamless frontend integration.
The backend can be managed using the following commands:
# Start the development server
npm run develop
# Build for production
npm run build
# Start the production server
npm run start
# Deploy the application
npm run deploy-
Clone the repository:
git clone https://github.com/Pizzaboi87/esplendor-strapi-backend.git
-
Install dependencies:
npm install
-
Set up environment variables: Create a .env file at the root of the project and configure the following variables:
# Server HOST=<your_host> PORT=<your_port> # Secrets APP_KEYS=<your_app_keys> API_TOKEN_SALT=<your_api_token_salt> ADMIN_JWT_SECRET=<your_admin_jwt_secret> TRANSFER_TOKEN_SALT=<your_transfer_token_salt> # Database DATABASE_URL_NEON=<your_database_url_neon> DATABASE_CLIENT=postgres DATABASE_HOST=<your_database_host> DATABASE_PORT=<your_database_port> DATABASE_NAME=<your_database_name> DATABASE_USERNAME=<your_database_username> DATABASE_PASSWORD=<your_database_password> DATABASE_SSL=true DATABASE_SSL_REJECT_UNAUTHORIZED=false JWT_SECRET=<your_jwt_secret> # Cloudinary CLOUDINARY_NAME=<your_cloudinary_name> CLOUDINARY_KEY=<your_cloudinary_key> CLOUDINARY_SECRET=<your_cloudinary_secret> # Email Providers SENDGRID_API_KEY=<your_sendgrid_api_key> RESEND_API_KEY=<your_resend_api_key>
-
Start the development server:
npm run develop
-
To build and start in production mode:
npm run build npm run start
The backend exposes a GraphQL API for interacting with the frontend. For detailed schema and queries, refer to the GraphQL playground (available in development mode).
This backend powers the live Esplend'or Rings website. Ensure that all deployments are tested in a staging environment before moving to production.
Contributions are welcome! If you'd like to improve this backend or report a bug, please submit a pull request or open an issue.