Skip to content

Repository files navigation

Fluminus Server

Get Started

Database config

droptable if exists fluminus.pn;
droptable if exists fluminus.notification;
createtableif not exists fluminus.pn(
user_id varchar(255) primary key,
idsrv varchar(1023),
jwt varchar(1023),
fcm_token varchar(255),
entry_time timestamp DEFAULT CURRENT_TIMESTAMPONUPDATECURRENT_TIMESTAMP
);
set time_zone='+08:00';
createtableif not exists fluminus.notification(
user_id varchar(255),
id integer
);

Request format

/api/activate_pn HTTP POST

{
"idsrv": "idsrv",
"jwt": "jwt",
"fcm_token": "fcm_token"
}

/api/deactivate_pn HTTP DELETE

{
"idsrv": "idsrv",
"jwt": "jwt"
}

Production mode

  • Configure prod.secret.exs file
config:fluminus_server,FluminusServerWeb.Endpoint,http: [:inet6,port: String.to_integer(System.get_env("API_SERVER_PORT")||"23333")],secret_key_base: secret_key_base
  • Configure prod.exs file
config:fluminus_server,FluminusServerWeb.Endpoint,url: [host: "your_running_url",port: 23333],cache_static_manifest: "priv/static/cache_manifest.json"
  • Some commands
export API_SERVER_PORT=23333
mix phx.gen.secret
export SECRET_KEY_BASE=[the secret generated just now]
export DATABASE_URL=ecto://[username]:[password]@localhost/[database_name]
mix phx.digest
mix deps.get --only prod
MIX_ENV=prod mix phx.server

Extras

To start your Phoenix server:

  • Install dependencies with mix deps.get
  • Create and migrate your database with mix ecto.setup
  • Install Node.js dependencies with cd assets && npm install
  • Start Phoenix endpoint with mix phx.server

Ready to run in production? Please check our deployment guides.

About

Server for registering and deactivating push notification service for Fluminus app.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages