PARISH-WEBPAGE - is a full-stack application that aims to present a simple parish website with the ability to edit certain things like intentions and announcements, in the style of a simple "Wordpress". The project consists of three repositories:
Backend repository - This is the backend for the entire application that stores data about users, announcements, and intentions. The application utilizes Passport strategy for authentication and TypeORM for creating and managing the database.
/intentions
(POST, GET, PATCH, DELETE, PATCH with /:id/:childId)
/auth/login
(POST)
/auth/logout
(GET)
/users
(GET, POST, GET with /:id, DELETE, PATCH, GET /current, PATCH /current)
/announcements
(POST, GET, GET with /:id, PATCH, DELETE)
/uploads/:albumID/image
(POST)
/albums/types
(GET, POST, GET with /:id, DELETE, PATCH)
/albums
(GET, POST, GET with /:id, PATCH, DELETE)
/albums/image/:imageId
(DELETE)
To run the application, you need environment variables in .env
file . The default configuration is provided in the .env.example
file.
- Clone the
PARISH-WEBPAGE-BACKEND
repository to your computer.
git clone https://github.com/xyashino/parish-webpage-backend.git
- Open the terminal and go to the parish-webpage-front/ folder in the repository.
cd parish-webpage-backend/
- Install packages.
yarn
-
Configure environment variables
-
Run the application.
yarn start:dev
Below are the descriptions of environment variables for the example app configuration.
- PORT:The port number the application will run on.
- DOMAIN:The domain name for the application.
- CORS: The allowed origins for CORS requests. Must be divided by
,
.
- DB_NAME: The name of the database.
- DB_HOST: The hostname of the database server.
- DB_PORT: The port number for the database connection.
- DB_USERNAME: The username for the database connection.
- DB_PASSWORD:The password for the database connection.
- DB_MIGRATION_BASE: The base path for running database migrations.
- DB_LOGGINGSet to
true
to enable database logging. - DB_SYNCHRONIZE: Set to
true
to synchronize the database schema with the entities.
- ADMIN_PWD: The password for the default admin user.
- ADMIN_LOGIN: The login email for the default admin user.
- BCRYPT_SALT_ROUNDS: The number of rounds used in the bcrypt hashing algorithm.
- JWT_SECRET_KEY: : A random string of characters used for generating JWT tokens.
- JWT_EXPIRES_SECONDS: The expiration time for JWT tokens in seconds.
- JWT_PROTOCOL_SECURE: Set to
true
for HTTPS-only access. - JWT_HTTP_ONLY: Set to
true
to prevent client-side access to JWT tokens.
- UPLOAD_DIR: The directory to which uploaded files will be saved. Must have
/
at the end. - ALBUM_DIR: The directory for saving uploaded images.
- MAX_FILE_SIZE: The maximum size of uploaded files in bytes.
- TINIFY_KEY: The API key for image compression. You can get the key at https://tinypng.com/developers.