A headless cms for developers that want to focus on just the frontend.
https://trello.com/b/aFDc3tHi/cmelse
Contributions are welcome, just create an issue or pull request and we will review it ASAP.
To set the project up, a few base steps are required, and based on what you want to do there may be additional configuration steps.
Since the project runs on JavaScsript, we need to install node.js, make sure to use the node version defined in the .nvmrc which is located in the root of the project. Read more about this in node versions
In order to run multiple node versions in parallel, we suggest using the node version manager, or nvm for short.
NPM is our preferred package manager, it comes installed with Node automatically so no additional installation is required.
We use a Postman workspace to try out API requests, it is a collection of requests so it also gives a nice overview of all available endpoints. Contact the repository owner (EmJee1) if you want to join the Postman workspace.
- Start by cloning the repository from GitHub
git clone https://github.com/EmJee1/cmelse.git
- Go to the cmelse directory and install the npm packages with the helper command
npm run setup
.
These are the steps on how to set up the frontend, however you almost always need the backend to retrieve data. If you want to work on the front-end, odds are you have to set up the back-end as well.
- Move into the client directory
cd client
- Run the dev command to start the dev server
npm run dev
The back-end is a Node server with MongoDB database.
To run mongodb, you have 2 options:
- Use the provided docker-compose file (recommended)
- Install MongoDB as an application on your system
- Make sure docker desktop is installed on your system.
- In the root directory of the project, run the command
docker compose up -d
in your favorite terminal, this will start the MongoDB container. You are done now!
To install it locally on your system, follow the official documentation.
Copy the server/.env.example
and paste the contents in a server/.env
file.
Change the variables according to your configuration needs
Variable | Description | Default |
---|---|---|
CMS_PORT | Port that express listens on for requests | 3001 |
MONGODB_CONNECTION_STRING | String with connection info for MongoDB | "mongodb://127.0.0.1:27017/cmelse" |
FALLBACK_LOCALE | This is used if a unsupported locale is requested | "en" |
BCRYPT_SALT_ROUNDS | Salt rounds that bcrypt uses for hashing | 10 |
JSON_WEBTOKEN_SECRET | The json webtoken secret used for hashing | "" |
- Go into the server directory (
cd server
) - Run
npm run start:dev
We use GitHub actions to run automated checks on code-quality, consistency and automated tests. The checks we run are:
- Automated unit tests for the server (with Jest).
- ESLint on both the server and client projects.
- Build (with type-checking) the server and client