Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
welcoMattic committed Nov 15, 2023
1 parent 527aa7e commit 29a979c
Showing 1 changed file with 78 additions and 27 deletions.
105 changes: 78 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,105 @@
</p>
<h1 align="center">Starfleet</h1>

[![CircleCI](https://circleci.com/gh/jolicode/starfleet.svg?style=svg)](https://circleci.com/gh/jolicode/starfleet)

> Share your conferences activity to your buddies
## Requirements
### Requirements

This project requires:
A Docker environment is provided and requires you to have these tools available:

- Docker
- [mkcert](https://github.com/FiloSottile/mkcert)
- [pipenv](https://github.com/pypa/pipenv)
* Docker
* Bash
* PHP >= 8.1
* [Castor](https://github.com/jolicode/castor#installation)

## Installation
#### Castor

### Local
Once castor is installed, in order to improve your usage of castor scripts, you
can install console autocompletion script.

First, you will need to add `local.starfleet.app` to your hosts file:
```
127.0.0.1 local.starfleet.app
```
If you are using bash:

Install pipenv dependencies:
```bash
pipenv install
castor completion | sudo tee /etc/bash_completion.d/castor
```

Enter in pipenv shell to get access to `inv` command:
```bash
pipenv shell
```
If you are using something else, please refer to your shell documentation. You
may need to use `castor completion > /to/somewhere`.

Castor supports completion for `bash`, `zsh` & `fish` shells.

### Docker environment

The Docker infrastructure provides a web stack with:
- NGINX
- PostgreSQL
- PHP
- Traefik
- A container with some tooling:
- Composer
- Node
- Yarn / NPM

### Domain configuration (first time only)

Before running the application for the first time, ensure your domain names
point the IP of your Docker daemon by editing your `/etc/hosts` file.

This IP is probably `127.0.0.1` unless you run Docker in a special VM (like docker-machine for example).

Note: The router binds port 80 and 443, that's why it will work with `127.0.0.1`

Generate your SSL certificates with:
```bash
inv generate-certificates
```
echo '127.0.0.1 local.starfleet.app' | sudo tee -a /etc/hosts
```

### Starting the stack

Launch the stack by running this command:

If it's your first install of Starfleet, run:
```bash
inv start
castor start
```

Open [https://local.starfleet.app](https://local.starfleet.app) in your browser 🚀
> Note: the first start of the stack should take a few minutes.
The site is now accessible at the hostnames your have configured over HTTPS
(you may need to accept self-signed SSL certificate if you do not have mkcert
installed on your computer - see below).

### SSL certificates

HTTPS is supported out of the box. SSL certificates are not versioned and will
be generated the first time you start the infrastructure (`castor start`) or if
you run `castor infra:generate-certificates`.

If you have `mkcert` installed on your computer, it will be used to generate
locally trusted certificates. See [`mkcert` documentation](https://github.com/FiloSottile/mkcert#installation)
to understand how to install it. Do not forget to install CA root from mkcert
by running `mkcert -install`.

If you don't have `mkcert`, then self-signed certificates will instead be
generated with openssl. You can configure [infrastructure/docker/services/router/openssl.cnf](infrastructure/docker/services/router/openssl.cnf)
to tweak certificates.

You can run `castor infra:generate-certificates --force` to recreate new certificates
if some were already generated. Remember to restart the infrastructure to make
use of the new certificates with `castor up` or `castor start`.

### Builder

Having some composer, yarn or other modifications to make on the project?
Start the builder which will give you access to a container with all these
tools available:

If you need to enter a shell to run specific command, run the following command:
```bash
inv builder
castor builder
```

### Other tasks

Checkout `castor` to have the list of available tasks.

## Usage

By default, the fetchers are not configured and won't fetch anything. You first need to head to the admin and configure them in the `fetcher` menu, then you can run `inv fetch-conferences`.
Expand Down

0 comments on commit 29a979c

Please sign in to comment.